home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1995 February: Tool Chest / Dev.CD Feb 95 / Dev.CD Feb 95.toast / Tool Chest / Development Tools & Languages / Macintosh Common Lisp Related / interfaces / PInterface Translator / PInterfaces / Picker.p < prev    next >
Encoding:
Text File  |  1993-09-16  |  2.1 KB  |  92 lines  |  [TEXT/MPS ]

  1. {
  2. Created: Friday, October 20, 1989 at 8:56 AM
  3.     Picker.p
  4.     Pascal Interface to the Macintosh Libraries
  5.  
  6.     Copyright Apple Computer, Inc.    1987-1989
  7.     All rights reserved
  8. }
  9.  
  10.  
  11. {$IFC UNDEFINED UsingIncludes}
  12. {$SETC UsingIncludes := 0}
  13. {$ENDC}
  14.  
  15. {$IFC NOT UsingIncludes}
  16.     UNIT Picker;
  17.     INTERFACE
  18. {$ENDC}
  19.  
  20. {$IFC UNDEFINED UsingPicker}
  21. {$SETC UsingPicker := 1}
  22.  
  23. {$I+}
  24. {$SETC PickerIncludes := UsingIncludes}
  25. {$SETC UsingIncludes := 1}
  26. {$IFC UNDEFINED UsingQuickdraw}
  27. {$I $$Shell(PInterfaces)Quickdraw.p}
  28. {$ENDC}
  29. {$SETC UsingIncludes := PickerIncludes}
  30.  
  31. CONST
  32.  
  33. {
  34.  
  35.  }
  36.  
  37. MaxSmallFract = $0000FFFF;        {Maximum small fract value, as long}
  38.  
  39.  
  40. TYPE
  41.  
  42. SmallFract = INTEGER;
  43.  
  44. HSVColor = RECORD
  45.     hue: SmallFract;            {Fraction of circle, red at 0}
  46.     saturation: SmallFract;     {0-1, 0 for gray, 1 for pure color}
  47.     value: SmallFract;            {0-1, 0 for black, 1 for max intensity}
  48.     END;
  49.  
  50. { For developmental simplicity in switching between the HLS and HSVmodels, HLS
  51.  is reordered into HSL.  Thus both models start with hue and saturation values;
  52.  value/lightness/brightness is last. }
  53. HSLColor = RECORD
  54.     hue: SmallFract;            {Fraction of circle, red at 0}
  55.     saturation: SmallFract;     {0-1, 0 for gray, 1 for pure color}
  56.     lightness: SmallFract;        {0-1, 0 for black, 1 for white}
  57.     END;
  58.  
  59. CMYColor = RECORD
  60.     cyan: SmallFract;
  61.     magenta: SmallFract;
  62.     yellow: SmallFract;
  63.     END;
  64.  
  65.  
  66.  
  67. FUNCTION Fix2SmallFract(f: Fixed): SmallFract;
  68.     INLINE $3F3C,$0001,$A82E;
  69. FUNCTION SmallFract2Fix(s: SmallFract): Fixed;
  70.     INLINE $3F3C,$0002,$A82E;
  71. PROCEDURE CMY2RGB(cColor: CMYColor;VAR rColor: RGBColor);
  72.     INLINE $3F3C,$0003,$A82E;
  73. PROCEDURE RGB2CMY(rColor: RGBColor;VAR cColor: CMYColor);
  74.     INLINE $3F3C,$0004,$A82E;
  75. PROCEDURE HSL2RGB(hColor: HSLColor;VAR rColor: RGBColor);
  76.     INLINE $3F3C,$0005,$A82E;
  77. PROCEDURE RGB2HSL(rColor: RGBColor;VAR hColor: HSLColor);
  78.     INLINE $3F3C,$0006,$A82E;
  79. PROCEDURE HSV2RGB(hColor: HSVColor;VAR rColor: RGBColor);
  80.     INLINE $3F3C,$0007,$A82E;
  81. PROCEDURE RGB2HSV(rColor: RGBColor;VAR hColor: HSVColor);
  82.     INLINE $3F3C,$0008,$A82E;
  83. FUNCTION GetColor(where: Point;prompt: Str255;inColor: RGBColor;VAR outColor: RGBColor): BOOLEAN;
  84.     INLINE $3F3C,$0009,$A82E;
  85.  
  86. {$ENDC}    { UsingPicker }
  87.  
  88. {$IFC NOT UsingIncludes}
  89.     END.
  90. {$ENDC}
  91.  
  92.